package com.lcs.springcloud.service;

import com.lcs.springcloud.dao.OrderDao;
import com.lcs.springcloud.entity.OrderTbl;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderService {

    @Autowired
    OrderDao orderDao;

    public void insert(OrderTbl orderTbl) {
        orderDao.insert(orderTbl);
    }

    /**
     * 获取id获取数据
     * @param id
     * @return
     */
    @Trace
    @Tags({
            @Tag(key = "id", value = "arg[0]"),
            @Tag(key = "order", value = "returnedObj")
    })
    public OrderTbl get(Integer id) {
        return orderDao.get(id);
    }
}
